package com.example.springbootdemo1.Controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController//Controller和ResponseBody的联合
public class TeacherController {

    private static final Logger logger = LoggerFactory.getLogger(TestController.class.getName());//可以传String也可以传类
   /* private static final Logger logger = LoggerFactory.getLogger(TeacherController.class);*/
    @RequestMapping("/sayHello")
    public String sayHi() {
        logger.info("logger-info");
        logger.error("logger-error");
        logger.warn("warn");
        return "teacher say hi";
    }
}
